﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace ProjectFitus.Models
{

	public interface IDBFitusRepository
	{

		void InsertError(DateTime dt, string source, string stackTrace);

		#region Menuitems
		IEnumerable<MenuItem> GetMenuItemsByParentId(int parentId);
		#endregion

		#region SubSite functions

		SubSite GetSubsiteByTitle(string strTitle);

		SubSite GetSubsiteById(long subSiteId);

		void UpdateSubSite(SubSite editedSubSite);


		#endregion

		#region Article functions

		IEnumerable<ArticleContent> GetAllArticlesBySearchString(string strSearch);

		void AddArticle(ArticleContent article);

		IEnumerable<ArticleContent> GetAllArticles();

        IEnumerable<long> GetAuthorsIdsByArticleId(int articleId);

        IEnumerable<string> GetAuthorsStringByArticleId(int articleId);

		ArticleContent GetArticleById(long id);

		void UpdateArticle(ArticleContent editedArticle);

        IEnumerable<ArticleComment> GetArticleCommentsByArticleId(long articleId);

		void ArticleComment(ArticleComment c);

		int GetArticleSelectedCategoryId(long articleId);

		ArticleToCategory GetArticleToCategoryByIds(long articleId, int categoryId);

		void UpdateArticleToCategories(long articleId, int newCategoryId, int oldCategoryId);

		#endregion

		#region category functions

        IEnumerable<TextContentCategory> GetAllCategories();

		IEnumerable<SelectListItem> GetContentCategoryByParentId(int parentId, int catTypeid);

		IEnumerable<TextContentCategory> GetTextContentCategoriesByParentId(int parentId, int catTypeid);

		TextContentCategory GetCategoryNameById(int id);

		#endregion

		#region News functions

		void SaveChanges();	

		void AddNews(NewsContent news);

		IEnumerable<NewsContent> GetNewsByCategoryId(int id);

		IEnumerable<NewsContent> GetNews(int count);

		IEnumerable<NewsContent> GetAllNews();

		NewsContent GetNewsById(long id);

		void UpdateNews(NewsContent editedNews);

		int GetNewsSelectedCategoryId(long newsId);

		NewsToCategory GetNewsToCategoryByIds(long newsId, int categoryId);

		void AddNewsToCategories(NewsToCategory newNtc);

		void UpdateNewsToCategories(long newsId, int newCategoryId, int oldCategoryId);

		#endregion

		#region User functions

		long GetUserIdByAspNetUsrId(Guid aspNetUserId);

		User GetUserById(long usrId);

		// Add new User
		void AddNewUser(string usr, string email);

        void UpdateUser(User usr);

		IEnumerable<User> GetAllUsers();

		IEnumerable<User> GetAllUsersWithNames();

		IEnumerable<SelectListItem> GetAllUsersAsSelList();

		IEnumerable<User> GetUserAuthorsByArticleId(long articleId);

		void RemoveAuthorFromArticle(long artId, long usrId);

		#endregion

		#region Profession functions

		IEnumerable<ProfessionListItem> GetAllProfessions();

		List<SelectListItem> GetAllProfessionsViaSelectListItems();


		#endregion

		#region Specialist functions

		Specialist GetSpecialistById(long id);

		IEnumerable<Specialist> GetAllSpecialists();

		void InsertNewSpecialist(Specialist specs);

		void UpdateSpecialist(Specialist specs);

		#endregion

		#region Request functions

        #region MainRequest functions

        IEnumerable<Request> GetAllRequests();

		Request GetRequestById(long id);


		void CreateRequest(Request req);

		void UpdateRequest(Request req);

		IEnumerable<Request> Get_n_MostRecentRequestsAtPage_p(int n, int p);

        #endregion

        #region RequestResponse functions

        IEnumerable<RequestResponse> GetAllActiveRequestResponsesByRequestId(long requestId);

        IEnumerable<RequestResponse> GetAllRequestResponsesByRequestId(long requestId);

        void AddRequestResponse(RequestResponse reqresp);

        void DeReActivateRequestResponse(long responseId);
        #endregion

        #region RequestType functions

        IEnumerable<RequestType> GetAllRequestTypes();

        List<SelectListItem> GetAllRequestTypesViaSelectListItems();

        #endregion

        #endregion

        #region AssignmentStatusList functions

        IEnumerable<AssignmentStatusListItem> GetAllStatusNames();

        List<SelectListItem> GetAllStatusNamesViaSelectListItems();


		#endregion

        #region FitusLogger functions

        void LoggError(ErrorLog ex);

        #endregion
    }
}
